use strict;


=head1 NAME

  RTx::AssetTracker::Transaction -- Class Description
 
=head1 SYNOPSIS

  use RTx::AssetTracker::Transaction

=head1 DESCRIPTION


=head1 METHODS

=cut

package RTx::AssetTracker::Transaction;

use vars qw( @ISA );
@ISA= qw(RT::Transaction);

sub Create {

    my $self = shift;
    return $self->SUPER::Create(ObjectType => 'RTx::AssetTracker::Asset', @_);

}

sub _LookupTypes {
    "RTx::AssetTracker::Type-RTx::AssetTracker::Asset-RTx::AssetTracker::Transaction";
}

sub Asset {
    my $self = shift;
    return $self->ObjectId;
}

sub AssetObj {
    my $self = shift;
    return $self->Object;
}


$RT::Transaction::_BriefDescriptions{AddIP} = sub {
        my $self = shift;
        return $self->loc( "IP address [_1] added", $self->NewValue);
    };

$RT::Transaction::_BriefDescriptions{DelIP} = sub {
        my $self = shift;
        return $self->loc( "IP address [_1] deleted", $self->OldValue);
    };

$RT::Transaction::_BriefDescriptions{TicketLink} = sub {
        my $self = shift;
        my $ticket = RT::Ticket->new( $self->CurrentUser );
        $ticket->Load($self->NewValue) or return $self->loc("Ticket #[_1] linked", $self->NewValue);
        return $self->loc( "Ticket #[_1] : [_2] ([_3])", $self->NewValue, $ticket->Subject, $ticket->Status);
    };


1;
